<template>
  <div class="loginPage">
    <!-- 背景装饰 -->
    <div class="background-decoration">
      <div class="floating-shapes">
        <div class="shape shape-1"></div>
        <div class="shape shape-2"></div>
        <div class="shape shape-3"></div>
        <div class="shape shape-4"></div>
        <div class="shape shape-5"></div>
      </div>
      <div class="grid-pattern"></div>
    </div>
    
    <!-- 左侧内容区域 -->
    <div class="left-content">
      <div class="welcome-section">
        <img class="textLogo" src="@/assets/images/logo-text.png" alt="login" />
        <h1 class="welcome-title">欢迎使用RBAC管理系统</h1>
        <p class="welcome-subtitle">基于角色的访问控制系统，为您提供安全、高效的管理体验</p>
        <div class="feature-list">
          <div class="feature-item">
            <el-icon><User /></el-icon>
            <span>用户权限管理</span>
          </div>
          <div class="feature-item">
            <el-icon><Lock /></el-icon>
            <span>安全访问控制</span>
          </div>
          <div class="feature-item">
            <el-icon><Setting /></el-icon>
            <span>灵活配置管理</span>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 右侧登录表单 -->
    <div class="right-content">
      <LoginForm class="loginForm" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { User, Lock, Setting } from '@element-plus/icons-vue'
import LoginForm from '@/views/system/login/loginForm.vue'
</script>

<style scoped lang="less">
.loginPage {
  width: 100%;
  height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  // 背景装饰
  .background-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;

    .floating-shapes {
      position: absolute;
      width: 100%;
      height: 100%;

      .shape {
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        animation: float 6s ease-in-out infinite;

        &.shape-1 {
          width: 80px;
          height: 80px;
          top: 20%;
          left: 10%;
          animation-delay: 0s;
        }

        &.shape-2 {
          width: 120px;
          height: 120px;
          top: 60%;
          left: 5%;
          animation-delay: 1s;
        }

        &.shape-3 {
          width: 60px;
          height: 60px;
          top: 30%;
          right: 15%;
          animation-delay: 2s;
        }

        &.shape-4 {
          width: 100px;
          height: 100px;
          bottom: 20%;
          right: 10%;
          animation-delay: 3s;
        }

        &.shape-5 {
          width: 40px;
          height: 40px;
          top: 80%;
          left: 20%;
          animation-delay: 4s;
        }
      }
    }

    .grid-pattern {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
      background-size: 50px 50px;
      animation: gridMove 20s linear infinite;
    }
  }

  // 左侧内容
  .left-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 2rem;

    .welcome-section {
      text-align: center;
      color: white;
      max-width: 500px;

      .textLogo {
        width: 15rem;
        margin-bottom: 2rem;
        filter: brightness(0) invert(1);
      }

      .welcome-title {
        font-size: 2.5rem;
        font-weight: bold;
        margin-bottom: 1rem;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      }

      .welcome-subtitle {
        font-size: 1.1rem;
        margin-bottom: 3rem;
        opacity: 0.9;
        line-height: 1.6;
      }

      .feature-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;

        .feature-item {
          display: flex;
          align-items: center;
          gap: 1rem;
          padding: 1rem;
          background: rgba(255, 255, 255, 0.1);
          border-radius: 10px;
          backdrop-filter: blur(10px);
          border: 1px solid rgba(255, 255, 255, 0.2);
          transition: all 0.3s ease;

          &:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(10px);
          }

          .el-icon {
            font-size: 1.5rem;
            color: #fff;
          }

          span {
            font-size: 1rem;
            font-weight: 500;
          }
        }
      }
    }
  }

  // 右侧登录表单
  .right-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 2rem;

    .loginForm {
      width: 100%;
      max-width: 400px;
    }
  }
}

// 动画定义
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .loginPage {
    flex-direction: column;

    .left-content {
      flex: none;
      height: 40vh;
      padding: 1rem;

      .welcome-section {
        .textLogo {
          width: 10rem;
        }

        .welcome-title {
          font-size: 1.8rem;
        }

        .welcome-subtitle {
          font-size: 1rem;
        }

        .feature-list {
          display: none;
        }
      }
    }

    .right-content {
      flex: none;
      height: 60vh;
      padding: 1rem;

      .loginForm {
        max-width: 100%;
      }
    }
  }
}
</style>
